<template>
  <div>
    <div class="c1">
      <h4>订单信息</h4>
    </div>
    <div>
      <van-cell is-link @click="showPopup">订单</van-cell>
      <van-popup v-model:show="show" position="bottom" :style="{ height: '50%' }">
        <div v-for="o in order">
          {{ o.uname }},{{ o.address }},{{ o.fname }},{{ o.num }},{{ o.ctime }}
        </div>
      </van-popup>
    </div>
  </div>
</template>

<script>
export default {
  name: "OrderView",
  data() {
    return {
      order: [],
      show: false
    }
  },
  methods: {
    showPopup() {
      if (!this.show) {
        this.show = true;
      } else {
        this.show = false;
      }
      this.axios.get("/order/selectInfo.do").then(r => {
        if (r.data.code == 200) {
          this.order = r.data.data;
        } else {
          this.$toast("订单丢了");
        }
      })
    }
  }
}
</script>

<style scoped>
.c1 {
  margin-top: 20px;
}
</style>